﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Management;
using System.Text;
using WMI.NET.Abstracts;
using WMI.NET.CIM;

namespace WMI.NET.ComputerSystemHardware.MotherboardControllerPort
{
    /// <summary>
    /// The Win32_1394Controller WMI class represents the capabilities and management of a 1394 controller. IEEE 1394 is a specification for a high-speed serial bus.
    /// </summary>
    public class Win32_1394Controller : CIM_Controller
    {

        private string _Manufacturer;

        /// <summary>
        /// Manufacturer of the controller.
        /// </summary>
        public string Manufacturer { get { return _Manufacturer; } }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public Win32_1394Controller(ManagementBaseObject mbo)
            :base(mbo)
        {
            _Manufacturer = mbo.GetStringValue("Manufacturer");
        }

    }

    /// <summary>
    /// 
    /// </summary>
    public class GetWin32_1394Controllers : Win32Collection<Win32_1394Controller>
    {

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override ReadOnlyCollection<Win32_1394Controller> GetCollection()
        {
            List<Win32_1394Controller> tempCollection = new List<Win32_1394Controller>();

            foreach (var s in searcher.Get())
            {
                Win32_1394Controller tempListItem = new Win32_1394Controller(s);
                tempCollection.Add(tempListItem);
            }

            return tempCollection.AsReadOnly();
        }

        /// <summary>
        /// 
        /// </summary>
        public GetWin32_1394Controllers() : base("SELECT * FROM Win32_1394Controller") { }

    }

}
